<template>
  <div class="setting-container">
    <user-bg></user-bg>

    <div class="tab-cell space-between">
      <div class="tab">
        <p class="num">5468</p>
        <p class="name">佣金</p>
      </div>
      <div class="tab">
        <p class="num">{{user_info.store_count}}</p>
        <p class="name">门店</p>
      </div>
    </div>

    <div class="cell-wrap">
      <mt-cell class="cell" title="我的门店" is-link to="myStore">
        <i class="icon iconfont iconshouye" slot="icon"></i>
        <span class="name"></span>
      </mt-cell>
      <mt-cell class="cell" title="我的推广码" is-link to="erCode">
        <i class="icon iconfont iconqrcode" slot="icon"></i>
        <span class="name"></span>
      </mt-cell>
      <mt-cell class="cell" title="提现" is-link to="commission">
        <i class="icon iconfont iconshezhi" slot="icon"></i>
        <span class="name"></span>
      </mt-cell>
      <div class="line"></div>
      <mt-cell class="cell" title="账号设置" is-link to="accountSettings">
        <i class="icon iconfont iconshezhi" slot="icon"></i>
        <span class="name"></span>
      </mt-cell>
    </div>

    <bot-contact></bot-contact>
  </div>
</template>

<script>
import userBg from "@/components/userBg";
import botContact from "@/components/botContact";
import constant from "@/util/constant";
import http from "@/util/http";
import { Toast } from "mint-ui";
import { Cell } from "mint-ui";
export default {
  name: "index",
  data() {
    return {
      user_info:{}
    };
  },
  components: {
    userBg,
    botContact,
    Cell
  },
  computed: {},
  created() {},
  mounted() {
    this.userinfo();
  },
  activated() {
    this.userinfo();
  },
  methods: {
    loginOut() {
      localStorage.removeItem("user_token");
      localStorage.removeItem("user_name");
      window.location.href = "/";
    },
    userinfo() {
      http.get(this, {
        url: "ucenter/user_info",
        data: {
          token: localStorage.getItem("user_token")
        },
        dataType: "json",
        success: function(data) {
          console.log("用户信息:", data);
          if (data.status == 1) {
            this.user_info = data.info;
          } else {
          }
        }
      });
    }
  }
};
</script>

<style lang="less" scoped>
.promise(@css, @args) {
  @{css}: @args;
  -webkit-@{css}: @args;
  -moz-@{css}: @args;
  -ms-@{css}: @args;
  -o-@{css}: @args;
}
.setting-container {
  padding-bottom: 140/37.5rem;
  .tab-cell {
    width: 100%;
    padding: 0.8rem 0;
    border-bottom: 12/37.5rem solid #eee;
    .tab {
      width: 50%;
      color: #666;
      text-align: center;
      .num {
        font-size: 28/37.5rem;
        text-align: center;
        margin-bottom: 0.2rem;
      }
      .name {
        font-size: 30/37.5rem;
        text-align: center;
      }
      & + .tab {
        border-left: 1px solid #ccc;
      }
    }
  }
  .cell-wrap {
    .iconfont {
      color: #bc9f5b;
    }
    .line {
      width: 100%;
      height: 12/37.5rem;
      background: #eee;
    }
  }
}
</style>
